const CONFIG = {
  needAuth: false, //是否需要进行身份认证
  baseURL: 'http://101.43.127.95/statistic', // 决策子系统后端API
  tileServer: 'http://101.43.127.95/pg_tileserv',
  featureServer: 'http://101.43.127.95/pg_featureserv',     // 空间要素服务
  tableServe: 'http://101.43.127.95/postgrest',
  glyphs: 'http://101.43.127.95/foxgis-api/fonts/v1/tax/{fontstack}/{range}.pbf',
  thCloudURL: 'http://101.43.127.95', // 云服务地址，主要提供底图服务及行政区划数据服务
  taxMapUrl:'http://101.43.127.95/tax-map',
  bmapService: {                                           // 底图服务
    image: {
      type: 'raster',
      tileSize: 256,
      tiles:[`http://101.43.127.95/mapproxy/wmts/img_c/cgcs2000/{z}/{x}/{y}.png`]
    },
    image_label: {
      type: 'raster',
      tileSize: 256,
      tiles: [`http://101.43.127.95/mapproxy/wmts/cia_c/cgcs2000/{z}/{x}/{y}.png`]
    },
    vector:{
      type:'raster',
      tileSize: 256,
      tiles: [`http://101.43.127.95/mapproxy/wmts/vec_c/cgcs2000/{z}/{x}/{y}.png`]
    },
    vector_label:{
      type:'raster',
      tileSize: 256,
      tiles: [`http://101.43.127.95/mapproxy/wmts/cva_c/cgcs2000/{z}/{x}/{y}.png`]
    }
  }
}
export default {
  owner: 'tax',
  type: 'style',
  name: '税务底图别删',
  version: 8,
  center: [116.341936, 36.964336],
  zoom: 3.54,
  bearing: 0,
  pitch: 0,
  sources: {
    天地图影像: CONFIG.bmapService.image,
    天地图注记: CONFIG.bmapService.image_label,
    全球行政区划: {
      type: 'geojson',
      data: `${CONFIG.thCloudURL}/基础地理信息数据/全球行政区划.json`
    },
    国界线: {
      type: 'geojson',
      data: `${CONFIG.thCloudURL}/基础地理信息数据/国界线.json`
    },
    南海诸岛: {
      type: 'geojson',
      data: `${CONFIG.thCloudURL}/基础地理信息数据/南海诸岛.json`
    },
    省级行政区划: {
      type: 'geojson',
      data: `${CONFIG.thCloudURL}/基础地理信息数据/省级行政区划.json`
    },
    行政区划注记: {
      type: 'geojson',
      data: `${CONFIG.thCloudURL}/基础地理信息数据/行政区划注记.json`
    },
    省级注记: {
      type: 'geojson',
      data: `${CONFIG.thCloudURL}/基础地理信息数据/省级注记.json`
    },
    标注点: {
      type: 'geojson',
      data: `${CONFIG.thCloudURL}/基础地理信息数据/标注点.json`
    }
  },
  glyphs: CONFIG.glyphs,
  layers: [
    {
      type: 'background',
      paint: {
        'background-color': '#0c3264'
      },
      layout: {
        visibility: 'visible'
      },
      id: 'background'
    },
    {
      type: 'fill',
      source: '全球行政区划',
      paint: {
        'fill-color': '#071733'
      },
      layout: {},
      id: '全球行政区划'
    },
    {
      layout: {
        visibility: 'visible'
      },
      type: 'fill',
      source: '南海诸岛',
      id: '南海诸岛',
      paint: {
        'fill-color': '#666'
      }
    },
    {
      layout: {},
      type: 'line',
      source: '省级行政区划',
      id: '省级行政区划',
      paint: {
        'line-color': 'red'
      }
    },
    {
      layout: {
        visibility: 'visible'
      },
      type: 'line',
      source: '国界线',
      id: '国界线',
      paint: {
        'line-color': '#fff',
        'line-width': 4
      }
    },
    {
      type: 'raster',
      source: '天地图影像',
      paint: {
        'raster-brightness-max': 0.7
      },
      layout: {
        visibility: 'none'
      },
      id: '卫星影像',
      minzoom: 1,
      maxzoom: 22
    },
    {
      type: 'raster',
      source: '天地图注记',
      layout: {
        visibility: 'none'
      },
      id: '卫星影像注记',
      minzoom: 1,
      maxzoom: 22
    },
    {
      layout: {
        visibility: 'none',
        'text-field': '{name}',
        'text-size': 12
      },
      maxzoom: 5,
      type: 'symbol',
      source: '省级行政区划',
      id: '钻取图层',
      paint: {
        'text-color': 'hsl(0, 0%, 39%)'
      }
    },
    {
      minzoom: 5,
      layout: {
        visibility: 'none',
        'text-field': '{NAME}',
        'text-size': 14
      },
      maxzoom: 7,
      filter: ['==', 'type', '地市、自治州'],
      type: 'symbol',
      source: '行政区划注记',
      id: '市级注记',
      paint: {
        'text-color': 'hsl(0, 0%, 37%)'
      }
    },
    {
      minzoom: 6,
      layout: {
        visibility: 'none',
        'text-field': '{NAME}',
        'text-size': 14
      },
      filter: ['==', 'type', '区县'],
      type: 'symbol',
      source: '行政区划注记',
      id: '县级注记',
      paint: {
        'text-color': 'hsl(0, 0%, 37%)'
      }
    },
    {
      layout: {
        'icon-image': 'capital',
        'icon-allow-overlap': true,
        'icon-ignore-placement': true
      },
      filter: ['==', 'tag', '首都'],
      type: 'symbol',
      source: '标注点',
      id: '首都注记',
      paint: {}
    },
    {
      layout: {
        'text-field': '中华人民共和国',
        'text-size': 24,
        'text-letter-spacing': 0.38,
        'text-max-width': 16.2
      },
      filter: ['==', 'tag', '中国'],
      type: 'symbol',
      source: '标注点',
      id: '中国注记',
      paint: {
        'text-color': '#00c8c8',
        'text-halo-color': '#64748c',
        'text-halo-width': 1,
        'text-halo-blur': 1
      }
    }
  ]
}
